package com.dhc.quartz;

import org.quartz.JobExecutionContext;
import org.quartz.JobExecutionException;
import org.quartz.JobListener;

public class JobListenerActive implements JobListener {
    @Override
    public String getName() {
        String simpleName = this.getClass().getSimpleName();
        System.out.println("监听器的name:"+simpleName);
        return simpleName;
    }

    @Override
    public void jobToBeExecuted(JobExecutionContext jobExecutionContext) {
        System.out.println("任务执行之前调用");
    }

    @Override
    public void jobExecutionVetoed(JobExecutionContext jobExecutionContext) {
        System.out.println("任务执行之前,但被TriggerListener否决后调用");
    }

    @Override
    public void jobWasExecuted(JobExecutionContext jobExecutionContext, JobExecutionException e) {
        System.out.println("任务执行完之后执行");
    }
}
